<template>
  <div class="all" ref="ActiveYear2">
    <div class="bg" v-if="reportSecondJson">
      <LImage class="img-bg" :src="Config.img('2201_bg.png')"></LImage>
      <div class="allab">
        <LImage class="img-stars" :src="Config.img('2201_stars.png')"></LImage>
      </div>
      <LImage class="img-spot-left" :src="Config.img('2201_left_spot.png')"></LImage>
      <LImage class="img-spot-right" :src="Config.img('2201_right_spot.png')"></LImage>
      <LImage class="img-log" :src="Config.img('2201_page2_logo.png')"></LImage>

      <LImage class="img-text" :src="Config.img('2201_page2_text.png')"></LImage>
      <div class="height60"></div>

      <richtext class="richtext" :style="{'background-color':stylek}">
        <span class="font30 text1">{{'从'}}</span>
        <span class="font44 text-yellow mb-2">{{reportSecondJson.firstStrategyName}}</span>
        <span class="font30 text1">{{'策略开始'}}</span>
      </richtext>

      <div class="height40"></div>
      <richtext class="richtext" :style="{'background-color':stylek}">
        <span class="font30 text1">{{'今年，你一共启动了'}}</span>
        <span class="font52 text-yellow">{{reportSecondJson.strategyNum}}</span>
        <span class="font30 text1">{{'个策略'}}</span>
      </richtext>
      
      <div class="height40"></div>
      <text v-if="reportSecondJson.strategyNum==undefined || reportSecondJson.strategyNum < 10" 
      class="font30 text1">{{'看起来对交易相当谨慎'}}</text>
      <richtext v-else class="richtext">
        <span class="font30 text1">{{'是个资深'}}</span>
        <span class="font44 text-yellow mb-2">{{'“整活达人”'}}</span>
      </richtext>

      <div class="height40"></div>
      <richtext v-if="reportSecondJson.inviteNum==undefined || reportSecondJson.inviteNum==0"
        class="richtext">
        <span class="font30 text1">{{'今年你通过Vtrading获得了'}}</span>
        <span class="font52 text-yellow">{{reportSecondJson.reward}}</span>
        <span class="font30 text-yellow">{{'VTN'}}</span>
        <span class="font30 text1">{{'交易奖励'}}</span>
      </richtext>
      <template v-else>
        <richtext class="richtext" :style="{'background-color':stylek}">
          <span class="font30 text1">{{'并且邀请了'}}</span>
          <span class="font52 text-yellow">{{reportSecondJson.inviteNum}}</span>
          <span class="font30 text1">{{'个小伙伴加入Vtrading'}}</span>
        </richtext>

        <div class="height40"></div>
        <richtext class="richtext" :style="{'background-color':stylek}">
          <span class="font30 text1">{{'获得'}}</span>
          <span class="font52 text-yellow">{{reportSecondJson.reward}}</span>
          <span class="font30 text-yellow">{{'VTN'}}</span>
          <span class="font30 text1">{{'返佣奖励'}}</span>
        </richtext>
      </template>
      
      <div class="all"></div>
      <div class="but" @stopPropagation="stopPropagation" @click="otClick"></div>
    </div>
  </div>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
  .richtext {
    background-color:rgba(0, 0, 0, 0)
  }
  .yinyue {
    position: absolute;
    right: 40;
    top: 40;
    width: 60px;
    height: 60px;
  }
  .text1 {
    color: #E5F3FF;
  }
  .bg {
    overflow: hidden;
    flex: 1;
    padding-left: 70px;
    padding-right: 70px;
  }
  .allab {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    justify-content: center;
    align-items: center;
  }
  .img-bg {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
  }
  .img-stars {
    width: 719px;
    height: 766px;
  }
  .img-spot-left {
    position: absolute;
    bottom: 348;
    left: 10;

    width: 88px;
    height: 93px;
  }
  .img-spot-right {
    position: absolute;
    bottom: 288;
    right: 0;
    
    width: 147px;
    height: 155px;
  }
  .img-log {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 750px;
    height: 635px;
  }

  .img-text {
    width: 296px;
    height: 119px;
    margin-top: 20px;
  }
  .but {
    height: 160px;
  }
  .mb40 {
    margin-bottom: 40px;
  }
  .text-yellow {
    color: #F6CF54;
  }
</style>

<script>

//功能
import jconfig from "@/_js/config";
import jmath from "@/_js/math"; 

export default {
  props:{
    data:{
      type:Object,
      default:undefined,
    },
  },

  data() {
    return {
      Config: jconfig,
      data:undefined,
      reportSecondJson:undefined,
    }
  },

  /* reportSecondJson 2
    *    inviteNum   注册时间
    *    partnerReward 奖励
    *    firstStrategyName  策略名称
    *    strategyNum        策略数量
    **/
  mounted(){
    var reportSecondJson = this.data.reportSecondJson;
    reportSecondJson.reward = jmath.xiaoshu(reportSecondJson.reward, 2, 2);
    this.reportSecondJson = reportSecondJson;
    setTimeout(() => {
      this.stylek = 'rgba(0, 0, 0, 0)';
      this.$forceUpdate();
    }, 1000);
  },

  methods:{
    
    /******************** 手势*/
    stopPropagation(){
      return true;
    },

    /******************** 按钮*/
    //查看
    otClick() {
      this.$emit("ot", this.$refs.ActiveYear2, 3);
    },
  }
}
</script>
